package com.lx.service;

import com.lx.dao.BooksMapper;
import com.lx.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BooksServiceImpl implements BooksService {
    //调用dao层的操作，设置一个set接口，方便Spring管理
    private BooksMapper booksMapper;
    public void setBookMapper(BooksMapper booksMapper) {
        this.booksMapper = booksMapper;
    }
    public int addBook(Books book) {
        return booksMapper.addBook(book);
    }
    public int deleteBookById(int id) {
        return booksMapper.deleteBookById(id);
    }
    public int updateBook(Books books) {
        return booksMapper.updateBook(books);
    }
    public Books queryBookById(int id) {
        return booksMapper.queryBookById(id);
    }
    public List<Books> queryAllBook() {
        return booksMapper.queryAllBook();
    }

    @Override
    public List<Books> queryBookByName(String queryParam) {
        return booksMapper.queryBookByParam(queryParam);
    }
}
